diff -urb libvmime-0.7.1.orig/src/body.cpp libvmime-0.7.1.patched/src/body.cpp
--- libvmime-0.7.1.orig/src/body.cpp	2005-03-18 22:26:46.000000000 +0100
+++ libvmime-0.7.1.patched/src/body.cpp	2007-11-01 16:45:20.688580500 +0100
@@ -173,7 +173,7 @@
 				++pos;
 			}
 
-			if (index > 0)
+			if (index > 0 && partStart < partEnd)
 			{
 				bodyPart* part = new bodyPart;
 
